﻿<div class="navbar navbar-inverse">
	<div class="navbar-inner">
		<div class="container-fluid" style="padding: 0px; padding-left: 20px;">
			<a class="brand" href="index" style="padding: 5px;"><small><img
					alt="" src="<%=contextPath%>/static/images/XTlogo.png" width="35px"
					height="35px" style="margin: 0px 8px;">${siteName }</small> </a>
			<ul class="nav ace-nav pull-right" id="msgLists">
				<li class="purple"><a href="javascript:alert('预留功能,待开发');"
					class="dropdown-toggle" data-toggle="dropdown"> <i
						class="icon-bell-alt icon-animated-bell icon-only"></i> <span
						class="badge badge-important">{{nextcount}}</span>
				</a>
					<ul
						class="pull-right dropdown-navbar navbar-pink dropdown-menu dropdown-caret dropdown-closer">
						<li class="nav-header"><i class="icon-warning-sign"></i> 
							新消息</li>
                        <template v-for="(next,index) in nextdatas">
						<li><s:hasPermission name="talentsRecommend:add"><a v-on:click='addchat(next.id)'>
								<div class="clearfix">
									<span class="pull-left"><i
										class="icon-comment btn btn-mini btn-pink"></i>跟踪对象: {{next.trueName}}</span> <span
										class="pull-right badge badge-info">上次沟通时间: {{next.nextTime}}</span>
								</div>
						</a></s:hasPermission></li>
						</template>
					</ul></li>
				<li class="light-blue user-profile"><a
					class="user-menu dropdown-toggle"
					href="javascript:alert('预留功能,待开发');" data-toggle="dropdown"> <!-- <img alt="FH" src="static/avatars/avatar.png" class="nav-user-photo" /> -->
						<span id="user_info"> </span> <i class="icon-caret-down"></i>
				</a>
					<ul id="user_menu"
						class="pull-right dropdown-menu dropdown-yellow dropdown-caret dropdown-closer">
						<li><a onclick="editUserH();" style="cursor: pointer;"><i
								class="icon-user"></i> 修改密码</a></li>
						<li id="systemset"><a
							onclick="javascript:alert('待开发模块')<!-- editSys(); -->"
							style="cursor: pointer;"><i class="icon-cog"></i> 系统设置</a></li>
						<li id="productCode"><a
							onclick="javascript:alert('待开发模块')<!-- productCode(); -->"
							style="cursor: pointer;"><i class="icon-cogs"></i> 代码生成</a></li>
						<li class="divider"></li>
						<li><a href="logout"><i class="icon-off"></i> 退出</a></li>
					</ul></li>
			</ul>
			<!--/.ace-nav-->
		</div>
		<!--/.container-fluid-->
	</div>
	<!--/.navbar-inner-->
</div>
<!--/.navbar-->


<!--引入属于此页面的js -->


<script type="text/javascript">
var lists = new Vue({
	  el: '#msgLists',
	  data: {
		  nextdatas:"",
		  nextcount:"",
	  },
	  mounted:function(){
		  this.$nextTick(function () {
              setInterval(this.timer, 20000);
          });
	    }
	    ,methods: {
	         timer: function () {
	        	 $.ajax({
	                 type: 'post',
	                 url: '<%=contextPath%>/demandCommunicate/msg',
	                 data:{'count':5}, 
	                 datatype:"json",
	                 success: function (data) {
	                 	lists.nextdatas=data.msgs;
	                 	lists.nextcount = data.count;
	                }
	            });
	            }
	        }
	})
//沟通记录
function addchat(id) {
	var diag = new top.Dialog();
	 diag.Drag=true;
	 diag.Title ="添加沟通记录";
	 diag.URL = "<%=contextPath%>/demandCommunicate/addView?talentsId=" + id;
	 diag.Width = 500;
	 diag.Height = 550;
	 diag.CancelEvent = function(){ //关闭事件
		//$("#table_list").trigger("reloadGrid");
		diag.close();
	 };
	 diag.show();
}
</script>
